package com.andy.blog.admin.controller;

import com.andy.blog.admin.dto.ServerDTO;
import com.andy.blog.admin.service.ServerBusService;
import com.andy.blog.common.reponse.GeneralResponseResult;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 服务器监控
 * Created by andy on 2023-04-05 11:38
 */
@RestController
@RequestMapping("/monitor/server")
public class ServerController {

    @Resource
    private ServerBusService serverBusService;

    /**
     * 查询服务监控信息
     */
    @PreAuthorize("@ss.hasPermi('monitor:server:list')")
    @GetMapping("/getServerInfo")
    public GeneralResponseResult<ServerDTO> getServerInfo() {
        return GeneralResponseResult.success(serverBusService.getServerInfo());
    }
}
